package com.ymatou.iapi.productmanager.service;

import java.util.List;

import org.json.JSONObject;

import com.google.common.reflect.TypeToken;
import com.ymatou.iapi.prodstock.parameter.FreezeProductResult;
import com.ymatou.iapi.productmanager.parameter.ProductBatchResultDto;
import com.ymt.base.BaseBean;
import com.ymt.base.YmatouBaseCall;
import com.ymt.core.tool.FormatUtil;
import com.ymttest.business.YmatouAutoTestCall;
import com.ymttest.utils.EnvSetup;
/**
*修改商品名称Call
*FreeMaker Template自动生成代码
*/
public class ModifyProductNameCall extends YmatouAutoTestCall{
	private static String opurl ="api/SellerProduct/ModifyProductName";
	
	public ModifyProductNameCall() {
		super(EnvSetup.getSystemUrl("productmanager"),opurl,"POST","JSON");
	}
	@Override
	public void addDefHeader() {
		client.addHeader("Accept","text/xml,text/javascript,text/html,application/json");
		client.addHeader("Content-Type", "application/json; charset=UTF-8");
	}
	public List<ProductBatchResultDto> getProductList(){
		String sproductList=getJsonObject().get("Data").getAsJsonObject().get("productList").getAsJsonArray().toString();
		List<ProductBatchResultDto> productList=(List<ProductBatchResultDto>)FormatUtil.GSONToObject(sproductList, new TypeToken<List<ProductBatchResultDto>>(){}.getType());
		return productList;
	}
}